package com.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.common.utils.PageUtil;
import com.system.entity.Log;
import com.system.mapper.LogMapper;
import com.system.service.LogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.system.vo.request.LogPageReqVO;
import com.system.vo.response.PageVO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 系统日志 服务实现类
 * </p>
 *
 * @author XueHeng
 * @since 2020-09-17
 */
@Service
public class LogServiceImpl extends ServiceImpl<LogMapper, Log> implements LogService {

    @Override
    public PageVO<Log> selectAll(LogPageReqVO vo) {
        Page<Log> page = new Page<>(vo.getPageNum(),vo.getPageSize());
        IPage<Log> users = this.baseMapper.selectAll(page,vo);
        return PageUtil.getPage(users);
    }

    @Override
    @Transactional
    public void delete(List<String> logIds) {
        this.baseMapper.deleteBatchIds(logIds);
    }
}
